package com.twu.biblioteca.Models;

public class User {

    private int username;
    private String password;
    private String name;
    private String emailAddress;
    private String phoneNumber;

    public User(int username, String password, String name, String emailAddress, String phoneNumber) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.emailAddress = emailAddress;
        this.phoneNumber = phoneNumber;
    }

    public String getUserDetails() {
        return "Name : " + name + "\nEmail : " + emailAddress + "\nPhone : " + phoneNumber + "\n";
    }

    public int getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public String getLibraryNumber() {
        String libraryNumber = Integer.toString(getUsername());
        assert libraryNumber.length() == 7;
        return libraryNumber.substring(0, 3) + "-" + libraryNumber.substring(3);
    }
}
